package com.eastfair.home.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.home.dto.BuilderRepairReportDTO;
import com.eastfair.home.entity.BuilderRepairReport;
import com.eastfair.home.vo.BuilderRepairReportVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 搭建商报修申请 feign.
 *
 * @author dqq
 * @date 2022 /11/24
 */
@FeignClient(value = "home/builderRepairReport")
public interface BuilderRepairReportFeign {

    /**
     * 查询搭建商报修申请列表VO.
     *
     * @param pageParams the page params
     * @return the r
     */
    @ApiOperation("查询搭建商报修申请列表VO")
    @PostMapping("/query/builderRepairReport")
    R<Page<BuilderRepairReportVO>> queryBuilderRepairReport(@RequestBody PageParams<BuilderRepairReportDTO> pageParams);

    /**
     * 查询搭建商报修申请列表VO
     *
     * @param query the query
     * @return the r
     */
    @PostMapping("/query/builderRepairReport/list")
    R<List<BuilderRepairReportVO>> queryBuilderRepairReportList(@RequestBody BuilderRepairReportDTO query);

    /**
     * 报修单号获取搭建报修申请VO.
     *
     * @param repairReportNumber the repair report number
     * @return the by report repair number
     */
    @GetMapping("/get/{repairReportNumber}")
    R<BuilderRepairReportVO> getByReportRepairNumber(@PathVariable("repairReportNumber") String repairReportNumber);

    /**
     * 保存搭建商报修申请.
     *
     * @param builderRepairReportDTO the repair report dto
     * @return the r
     */
    @PostMapping("/save")
    R<BuilderRepairReport> saveBuilderRepairReport(@RequestBody BuilderRepairReportDTO builderRepairReportDTO);

    /**
     * 更新搭建商报修申请.
     *
     * @param builderRepairReportDTO the repair report dto
     * @return the r
     */
    @PostMapping("/update")
    R<BuilderRepairReport> updateBuilderRepairReport(@RequestBody BuilderRepairReportDTO builderRepairReportDTO);

    /**
     * 取消搭建商报修申请.
     *
     * @param repairReportNumber the repair report number
     * @return the r
     */
    @GetMapping("/cancel/{repairReportNumber}")
    R<Boolean> cancelBuilderRepairReport(@PathVariable("repairReportNumber") String repairReportNumber);

    /**
     * 更新搭建商报修申请为已完成.
     *
     * @param builderRepairReportDTO the repair report dto
     * @return the r
     */
    @PostMapping("/complete")
    R<Boolean> completeRepairReport(@RequestBody BuilderRepairReportDTO builderRepairReportDTO);

    /**
     * 更新搭建商报修申请是否预定了服务.
     *
     * @param builderRepairReportDTO the builder repair report dto
     * @return the r
     */
    @PostMapping("/update/isBookService")
    R<Boolean> updateIsBookService(@RequestBody BuilderRepairReportDTO builderRepairReportDTO);

    /**
     * 更新搭建商报修申请需赔付场馆金额.
     *
     * @param builderRepairReportDTO the builder repair report dto
     * @return the r
     */
    @PostMapping("/update/compensateVenueAmount")
    R<Boolean> updateCompensateVenueAmount(@RequestBody BuilderRepairReportDTO builderRepairReportDTO);
}